<template>
  <div class="dashboard-container">
    <p>国锐影视欢迎您！</p>
    <!-- <component :is="currentRole"/> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import adminDashboard from './admin'
import editorDashboard from './editor'
import eventBus from '@/api/eventBus';
export default {
  name: 'Dashboard',
  components: { adminDashboard, editorDashboard },
  data() {
    return {
      currentRole: 'adminDashboard'
    }
  },
  computed: {
    ...mapGetters([
      'roles'
    ])
  },
  mounted(){
    eventBus.$emit('refreshUserInfo');
  },
  created() {
    if (!this.roles.includes('admin')) {
      this.currentRole = 'editorDashboard'
    }
  }
}
</script>

<style lang="less" scoped>
.dashboard-container{
  padding: 1rem;
  p{
    margin: 0;
  }
}
</style>

